/** When your routing table is too long, you can split it into small modules**/

const routes = [
  {
    path: "/",
    redirect: "/home",
    meta: {
      title: "默认首页",
      isLogin: false,
      alive: true
    }
  },
  {
    path: "/404",
    component: () => import("@/views/404.vue"),
    meta: {
      title: "404",
      isLogin: false,
      alive: true
    },
    hidden: true
  },
  {
    path: "/home",
    name: "home",
    redirect: "/home/index",
    meta: {
      title: "首页",
      isLogin: false,
      alive: true
    },
    children: [
      {
        path: "/home/index",
        name: "home_index",
        component: () => import("@/views/home/index/index.vue"),
        meta: {
          title: "首页",
          isLogin: false,
          alive: true
        }
      },
      {
        path: "/goods/detail",
        name: "goods_detail",
        component: () => import("@/views/goods/detail/index.vue"),
        meta: {
          title: "首页",
          isLogin: false,
          alive: true
        }
      }
    ]
  },
  {
    path: "/user",
    name: "user",
    redirect: "/user/index",
    meta: {
      title: "用户中心",
      isLogin: false,
      alive: true
    },
    children: [
      {
        path: "/user/index",
        name: "user_index",
        component: () => import("@/views/user/index/index.vue"),
        meta: {
          title: "用户中心",
          isLogin: true,
          alive: true
        }
      }
    ]
  },
  {
    path: "/login",
    name: "login",
    component: () => import("@/views/login/index.vue"),
    meta: {
      title: "登录",
      isLogin: false,
      alive: true
    },
    hidden: true
  },
  {
    path: "*",
    redirect: "/404", // 404 page must be placed at the end !!!
    hidden: true
  }
];

export default routes;
